package com.itheima.web.job;

import com.itheimma.service.db.AnalysisByDayService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import sun.reflect.generics.tree.VoidDescriptor;

//分析工作，每隔30秒保存到分析表中
@Component
public class AnalysisJob {

    @DubboReference
    private AnalysisByDayService analysisByDayService;

    @Scheduled( cron = "0 0 0/1 * * ?")    //每隔一分钟发一次
    public void logToAnalysisByDay(){
        analysisByDayService.LogToAnalysisByDay();
        System.out.println("日志记录保存到每日分表中");
    }

}
